#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
    char buf=' ';
    char en='\n';
    char ov[]="Quit\n";
    while(buf!='q')
    {
        read(0,&buf,1);
        if(buf!='\n'&&buf!='q')
        {
        
            write(1,&buf,1);
        }
        if(buf=='\n')
        {
            write(1,&en,1);
        }
        if(buf=='q')
        {
            write(1,ov,strlen(ov));
        }
    }
    return 0;
}
